﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace HCQ2_Model.Pay
{
    /// <summary>
    /// 购买期限
    /// </summary>
    public class PurchasePeriodEnum
    {
        /// <summary>
        /// 永久
        /// </summary>
        public const int Permanent = 0;

        /// <summary>
        /// 1个月
        /// </summary>
        public const int OneMonth = 1;

        /// <summary>
        /// 3个月
        /// </summary>
        public const int ThreeMonth = 3;

        /// <summary>
        /// 6个月
        /// </summary>
        public const int SixMonth = 6;

        /// <summary>
        /// 一年
        /// </summary>
        public const int TwelveMonth = 12;

        /// <summary>
        /// 验证购买期限是否合法
        /// </summary>
        /// <param name="p"></param>
        /// <returns></returns>
        public static bool CheckPurchasePeriod(int p)
        {
            if (p == Permanent || p == OneMonth || p == ThreeMonth || p == SixMonth || p == TwelveMonth) {
                return true;
            }
            return false;
        }
    }
}
